  <tr valign="top">
    <td height="40" align="left" class="dato" background="/images/topHeader.gif" colspan="4">Categorias</td>
  </tr>
    <tr>
     <td colspan="4" align="center" background="/images/vg.jpg"><span class="subdatos">Información de categorias</span></td>
  </tr>
    <tr><td>&nbsp;</td></tr>

<table>

<% @categories.each do |category| %>
  <tr>
  	<td>
	<% if(category.photo_file_name.blank?)&(category.image.blank?) %>
		<%= image_tag("/images/default.jpg",  :size => "150x100" ) %>
		<% else %>
			<% if(category.photo_file_name.blank?)%>
				<%= image_tag category.image,  :size => "150x100" %>
				<% else %>
					<% if(category.image.blank?)%>
						<%= image_tag category.photo.url,  :size => "150x100" %>
						<% else %>
							<%= image_tag category.photo.url,  :size => "150x100" %>
					<% end %>
			<% end %>
	<% end %>
		
	</td>
	<td>
		<h1><%= category.name %></h1>
	</td>
    <td><%= link_to 'Mostrar', category %></td>
    <td><%= link_to 'Modificar', edit_category_path(category) %></td>
    <td><%= link_to 'Eliminar', category, :confirm => 'Esta seguro?', :method => :delete %></td>

  </tr>
<% end %>
<tr><td>&nbsp;</td></tr>
<tr><td>&nbsp;</td></tr>
<tr>
<td><%= link_to 'Nueva Categoria', new_category_path %></td>
</tr>
</tale>